package com.tourlaid.mamagerment.action.pc

import com.tourlaid.mamagerment.ao.pc.ShopGoodsAo
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController

/**
 * Created by xiaoyongge on 2017/7/20.
 */
@RestController
@RequestMapping("/tld/admin/shopgoods")
class ShopGoodsAction {

    @Autowired
    private val shopGoodsAo: ShopGoodsAo? = null

    @RequestMapping("/list.json")
    fun list(@RequestParam(defaultValue = "1") pageNo: Int,
             @RequestParam(defaultValue = "10") pageSize: Int,
             callback: String): String {
        val ResponseData = shopGoodsAo!!.list(pageNo, pageSize);
        return ResponseData.toJson(callback)
    }

//    @RequestMapping("/insert.json")
//    fun insert(shopName: String?, callback: String): String {
//        shopAo!!.insert(shopName);
//        return ResponseData<String>().toJson(callback)
//    }
//
//    @RequestMapping("/detail.json")
//    fun detail(shopId: Long?, callback: String): String {
//        var shopVo = shopAo!!.detail(shopId);
//        return ResponseData(shopVo).toJson(callback)
//    }
//
//    @RequestMapping("/update.json")
//    fun update(shopId: Long?, shopName: String?, callback: String): String {
//        shopAo!!.update(shopId, shopName);
//        return ResponseData<String>().toJson(callback)
//    }
//
//    @RequestMapping("/delete.json")
//    fun delete(shopId: Long?, callback: String): String {
//        shopAo!!.delete(shopId);
//        return ResponseData<String>().toJson(callback)
//    }
}